//@SuppressWarnings("all")

import java.util.Arrays;

/**
 * this is a test class
 */
public class Person {
    private String name;
    private static Person p;

    private Person() {
    }

    public static Person getInstance() {
        if (p == null) {
            p = new Person();
        }
        return p;
    }

    public void say(String name) {
        System.out.println("my name is " + name);
    }

    //冒泡排序
    public static void sortArry(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = 0; j < a.length - 1 - i; j++) {
                if (a[j + 1] < a[j]) {
                    int temp = 0;
                    temp = a[j + 1];
                    a[j + 1] = a[j];
                    a[j] = temp;
                }
            }
        }
        System.out.println("排序后的数组是->" + Arrays.toString(a));
    }

    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            Person p = Person.getInstance();
            System.out.println("p->" + p);
            p.say("zmj" + i);

        }
        int[] a = {8, 5, 3, 0, 4, 3, 2, 9};
        Person.sortArry(a);
    }

}
